<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>欢迎来到棒棒糖！</title>
<link rel="stylesheet" type="text/css" href="../Public/register/css/interface.css" />
<script type="text/javascript" src="../Public/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../Public/js/json2.js"></script>
<script type="text/javascript" src="../Public/js/publicjs.js"></script>
<script type="text/javascript" src="../Public/register/js/interface.js"></script>
<script type="text/javascript">
function checkMail(){
  var email=$("#email").val();  
  if(email==""||email==null||email==undefined){
   $("#mailresult").html('邮箱不可为空！'); 
   $("#email").focus();
    return;
  }
  $.get("checkMail",{email:email},function(data){
    var jsonobj=$.parseJSON(data);
    if(jsonobj.status===0){
    //该用户名已经被注册0
    $("#mailresult").html(jsonobj.info);    
    $("#email").focus();  
    return; 
    }
    if(jsonobj.status===1){
     $("#mailresult").html('该邮箱可以使用！');      
       
    }
  });
    
}
function checkName(){
 var name=$("#name").val();
  if(name==""||name==null||name==undefined){
    
    $("#nameresult").html('名字不可为空！');    
    $("#name").focus();   
  } 
  else{
    $("#nameresult").html('名字可以使用！');     
  } 
    
}
function checkpwd(){
  var pwd=$("#password").val();  
  if(pwd==""||pwd==null||pwd==undefined){
    $("#pwdresult").html('密码不可为空！');
     $("#password").focus();
    return;
 } 
   if(pwd.length<6||pwd.length>20){
   $("#pwdresult").html('密码6-20个字符');
    $("#password").focus(); 
   return; 
 }
 else{
    $("#pwdresult").html(''); 
    
 }  
}
function checkp(){
 var pwd=$("#password").val();  
 var repwd=$("#repassword").val();
 
 if(repwd==""||repwd==null||repwd==undefined){
    $("#psd").html('密码不可为空！');
    
    return;
 }  
 if(pwd!=repwd){
   $("#psd").html('密码输入不一致！');
    return;
 }
  if(repwd.length<6||repwd.length>20){
   $("#pwdresult").html('密码6-20个字符');
    $("#repassword").focus(); 
   return; 
 }
  else{
   $("#psd").html('密码符合要求！'); 
    
  }  
}
//重载验证码  
function freshVerify() {  
  document.getElementById('verifyImg').src='__URL__/verify/'+Math.random();  
}  
function checkVerify(){
  var verify=$("#yzm").val();
  $.post("{:U('Public/verifyCheck')}",{verify:verify},function(data){
    var jsonobj=$.parseJSON(data);
    if(jsonobj.status==0){
      alert(jsonobj.info); 
      freshVerify();
       $("#yzm").focus();
    }
  }); 
}
</script>
</head>
<body>

<div id='maincontainer'>
	<div id="logo"></div>
	<div id="container">
		<div id="title_b">
			<div id="title">
				<div id="title_w"></div>
			</div>
		</div>
		<div id="container_m">
        <div id="create" class="blueback" >
    		<table border="0" cellspacing="3px" cellpadding="0" style="font-family:'黑体';letter-spacing:3px;">
  				<tr>
    				<td colspan="2" id='ti_te' >创建一个Tang账户：</td>
    			</tr>
  				<tr >
    				<td width="27%" style="padding-top:20px;"><div align="right">你的名字&emsp;：</div></td>
    				<td width="73%" style="padding-top:20px;"><input type="text" name="name" id="name"  onblur="checkName()"/><span id="nameresult" style="margin-left:5px;color: red;font-size:8pt;"></span></td>
  				</tr>
  				<tr>
    				<td><div align="right">电子邮件&emsp;：</div></td> 
    				<td><input type="text" name="email" id="email" onblur=" checkMail()"/><span id="mailresult" style="margin-left: 5px;color: red;font-size:8pt;"></span></td>
  				</tr>
  				<tr>
    				<td><div align="right">密&emsp;&emsp;码&emsp;：</div></td>
    				<td><input type="password" name="password" id='password' onblur="checkpwd()" /><span id="pwdresult" style="margin-left: 5px;color: red;font-size:8pt;"></span></td>
  				</tr>
  				<tr>
    				<td><div align="right">确认密码&emsp;：</div></td>
    				<td><input type="password" name="repassword" id='repassword' onblur="checkp()"/><span id="psd" style="margin-left: 5px;color: red;font-size:8pt;"></span></td>
  				</tr>
  				<tr>
    				<td><div align="right">性&emsp;&emsp;别&emsp;：</div></td>
    				<td><select name="sex" id="sex">
						<option selected>男</option>
						<option >女</option>
						</select>
					</td>
  				</tr>
                 <tr>
                    <td><div align="right">验&nbsp;证&nbsp;码&nbsp;：</div></td>
                    <td><input type="text"  id="yzm" name="yzm" size="10" style="width:100px;" onblur="checkVerify()"/>
                    <img alt="" title='刷新验证码' id='verifyImg' onClick='freshVerify()' src="{:U('public/verify')}" width="80px" height="20px" style="margin-left:10px; margin-top:5px;"/></td>
                    </tr>
  				<tr>
    				<td style="padding-top:10px;"><div id='create_button' onclick="createuser()"></div></td>
       				<td>
                    	
                    </td>
  				</tr>
			</table>
		</div>
<div id="middleline"></div>
<div id="advise" style="float:left;height:285px; padding-left:10px;">
<div id="advise1" class="blueback" style="height:135px;width:240px;">
<img src="../Public/upload/head/{$user1.picture}"  style="height:135px;width:240px;" />
</div>
<div id="advise2" class="blueback" style="height:125px;width:240px; margin-top:20px;">
<img src="../Public/upload/head/{$user2.picture}"  style="height:135px;width:240px;" />
</div>
</div>
    </div>
        
		</div>
		<div id="about">
			<div>
		<a>所有内容©Tang-保留所有权利</a> <a href="#">联系我们</a> <a>|</a> <a href="#">隐私权政策</a> <a>|</a> <a href="#">服务条款</a>
			</div>
		</div>
	</div><!-- container结束 -->
</div><!-- maincontainer结束 -->
<!--<div id='middlecontainer'></div>-->
<div id="bottomcontainer"><div id="ship" onclick="shove_off(this)"></div></div>
</body>
</html>
